<?php

namespace App\Library;


class Singleton
{
    private static $_instance = null ;

    private function __construct()
    {
    }

    private function __clone()
    {
        // TODO: Implement __clone() method.
    }

    private function __sleep()
    {
        // TODO: Implement __sleep() method.
    }

    private function __wakeup()
    {
        // TODO: Implement __wakeup() method.
    }

    public static function getInstance()
    {
        if(!(self::$_instance instanceof Singleton)){
            self::$_instance = new Singleton();
        }

        return self::$_instance;
    }
}


$singleton = Singleton::getInstance();